<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>复合事件(有点像绑定事件)</title>
    <script type="text/javascript" src="../js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#textId").hover(
                function () {
                    $(this).css("background-color","yellow")
                },
                function () {
                    $(this).css("background-color","white")
                }
            )
        })
    </script>

</head>
<body>
       <div style="border: 3px solid red;" id="textId">
           hello text
       </div>
</body>
</html>